package com.story.modular.app.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.story.common.persistence.model.CategoryClass;
import com.story.common.persistence.model.apphome;
import com.story.modular.app.constrant.QueryListForm;
import com.story.modular.app.dao.apphomeMapper;
import com.story.modular.app.service.AppHomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class apphomeServiceImpl implements AppHomeService {

    @Autowired
    private apphomeMapper apphomeMapper;

    @Override
    public apphome queryObject(Integer id) {

        return apphomeMapper.getByid(id);
    }

    @Override
    public List<apphome> queryList(Map<String, Object> map) {
        return null;
    }
    @Override
    public List<Map<String,Object>> queryList(QueryListForm queryListForm) {
        return apphomeMapper.queryList(queryListForm.getClasstypeId(),queryListForm.getPageclassId(),queryListForm.getViewTitle());
    }

    @Override
    public List<Map<String,Object>> queryPageList(Page<apphome> page, QueryListForm queryListForm) {

        return apphomeMapper.queryPageList(page,queryListForm.getViewTitle(),queryListForm.getClasstypeId(),queryListForm.getPageclassId());
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return 0;
    }

    @Override
    public int save(apphome category) {
        apphomeMapper.insertSelective(category);
        return category.getId();
    }

    @Override
    public int update(apphome category) {
        return apphomeMapper.updateByPrimaryKeySelective(category);
    }

    @Override
    public int delete(Integer id) {
        return apphomeMapper.deleteById(id);
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        return 0;
    }
}
